[PATCH] Check for non-existent local repo
authorIan Campbell <ian.campbell@xensource.com>
Tue, 5 Jun 2007 14:52:46 +0000 (15:52 +0100)
committerIan Campbell <ian.campbell@xensource.com>
Tue, 5 Jun 2007 14:52:46 +0000 (15:52 +0100)
Check for non-existent local clone in select-repository.
Also change the #!/bin/bash to #!/bin/sh since the Makefile is calling
it explicitly with sh, and fix a couple other typos.

Signed-off-by: Aron Griffis <aron@hp.com>
buildconfigs/select-repository

index ef1df59ac33bc52b04fca000c46e200a75f745f3..d32db069f38a1bfb1070d7f30b9881a7f7ad61b0 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 ME=$(basename $0)
 
@@ -39,10 +39,14 @@ if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
 fi
 
 BASE=$(dirname ${XEN})
-if [ $? -ne 0 ] || [ X"$XEN" = "X" ] ; then
-    echo "$ME: Unable to determine Xen repository parent." 1>&2
+if [ $? -ne 0 ] || [ X"$BASE" = "X" ] ; then
+    echo "$ME: Unable to determine Xen repository base." 1>&2
     exit 1;
 fi
+if [ -d "$XEN" ] && [ ! -d "$BASE/$REPO" ] ; then
+    echo "$ME: No such dir: $BASE/$REPO" 1>&2
+    exit 1
+fi
 
 echo "$ME: Found ${BASE}/${REPO}" 1>&2